<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="sysDefault" />
<script
	src="${staticPath}/lib/jquery-datatables/1.9.4/js/jquery.dataTables.min.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${staticPath}/lib/jquery/1.10.2/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
	});
	function funform(url, target) {
		window.open(url, target);
	}
</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
							区域管理列表
							<button class="btn btn-success btn-sm pull-right"
								onclick="funform('${contextPath}/sys/base/region/addRegion','_self');">新增</button>
						</h3>
					</div>
					<form:form  name="listForm" modelAttribute="sysBaseRegion"
						action="${contextPath}/sys/base/regionShopFloor/getRegionList"
						class="form-inline" role="form" method="post">
						<div class="form-group">
							<form:input path="name" class="form-control" placeholder="名称" />
						</div>
						<div class="form-group">
							<form:input path="zipCode" class="form-control"
								placeholder="邮政编码" />
						</div>
						<div class="form-group">
							<form:input path="level" class="form-control" placeholder="区域级别" />
						</div>
						<button class="btn btn-primary" type="submit">查询</button>
					</form:form>
					<tags:message content="${message}" />
					<table class="table table-striped table-bordered table-hover">
						<thead>
						</thead>
						<thead>
							<tr>
								<th>区域名称</th>
								<th>电话区号</th>
								<th>邮政编码</th>
								<th>区域级别</th>
								<th>国家代码</th>
								<th>所属区域</th>
								<th>是否是父节点</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="region" items="${page.list}" varStatus="i">
								<tr>
									<td>${region.name}</td>
									<td>${region.teleCode}</td>
									<td>${region.zipCode }</td>
									<td>${region.level}</td>
									<td>${region.countryCode}</td>
									<td>${region.parentArea}</td>
									<td><c:if test="${region.flag =='0'}">
										父节点
									  </c:if> <c:if test="${region.flag =='1'}">
										叶子节点
									  </c:if></td>
									<td><a
										href="${contextPath}/sys/base/region/viewRegion?code=${region.code}&parentArea=${region.parentArea}">查看</a>
										<a
										href="${contextPath}/sys/base/region/updateRegion?code=${region.code}&parentArea=${region.parentArea}">修改</a>
										<c:if test="${region.flag =='0'}">
										删除
									    </c:if> <c:if test="${region.flag =='1'}">
											<a
												href="${contextPath}/sys/base/region/removeRegion?code=${region.code}&parentArea=${region.parentArea}"
												onclick="return Oosp_Confirm('确认要删除该条数据吗？', this.href)">删除</a>

										</c:if></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="panel-footer">
						<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}"
							url="" total="${page.total}" />
						<script type="text/javascript" src="${staticPath}/js/list.js"></script>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>